import Vue from 'vue'
import Vuex from 'vuex'
import VueRouter from 'vue-router'
import VueClipboard from 'vue-clipboard2'
import { BootstrapVue, IconsPlugin } from 'bootstrap-vue'
import App from './App.vue'
import AllArticles from './components/article/AllArticles.vue'
import Dashboard from './components/Dashboard.vue'
import NewArticle from './components/article/NewArticle.vue'
import Catalogs from './components/catalog/Catalogs.vue'
import CatalogDetails from './components/catalog/CatalogDetails.vue'
import Tags from './components/tag/Tags.vue'
import TagDetails from './components/tag/TagDetails.vue'
import Medias from './components/medias/Medias.vue'
import MediaDetail from './components/medias/MediaDetail.vue'
import Themes from './components/theme/Themes.vue'
import SettingNormals from './components/SettingNormals.vue'
import SettingWrite from './components/SettingWrite.vue'
import SettingDiscuss from './components/SettingDiscuss.vue'
import 'bootstrap/dist/css/bootstrap.css'
import 'bootstrap-vue/dist/bootstrap-vue.css'

Vue.use(Vuex)
Vue.use(VueRouter)
Vue.use(BootstrapVue)
Vue.use(IconsPlugin)
Vue.use(VueClipboard)

Vue.config.productionTip = false

const store = new Vuex.Store({
	state:{
		menuState: 'open',
		menuFoucs: 'main'
	},
	mutations:{
		menuOpr (state, menuState){
			state.menuState = menuState
		},
		menuFoucsOpr (state, menuFoucs){
			state.menuFoucs = menuFoucs
		}
	}
})

const routes = [
	{path: '/articles', component: AllArticles},
	{path: '/new-articles', name: 'new-articles', component: NewArticle},
	{path: '/update-articles', name: 'update-articles', component: NewArticle},
	{path: '/catalogs', component: Catalogs},
	{path: '/catalog-details', name: "catalog-details", component: CatalogDetails},
	{path: '/tags', component: Tags},
	{path: '/tag-details', name: "tag-details", component: TagDetails},
	{path: '/medias', component: Medias},
	{path: '/media-detail', name: "media-detail", component: MediaDetail},
	{path: '/themes', component: Themes},
	{path: '/setting-normals', component: SettingNormals},
	{path: '/setting-write', component: SettingWrite},
	{path: '/setting-discuss', component: SettingDiscuss},
	{path: '/', component: Dashboard}
]

const router = new VueRouter({
	routes
})

new Vue({
  render: h => h(App),
  store,
  router
}).$mount('#app')
